package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import org.hibernate.annotations.common.util.StringHelper;

import cn.itcast.crm.domain.Customer;

/**
 * 客户操作
 * 3 根据地址添加获取定区编码的方法
 * 4 bos_management去修改OrderService#saveOrder()
 * @author itcast
 *
 */
public interface CustomerService {

	@Path("/noassociationcustomers")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findNoAssociationCustomers();

	@Path("/associationfixedareacustomers/{fixedareaid}")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findHasAssociationFixedAreaCustomers(
			@PathParam("fixedareaid") String fixedAreaId);

	@Path("/associationcustomerstofixedarea")
	@PUT
	public void associationCustomersToFixedArea(
			@QueryParam("customerIdStr") String customerIdStr,
			@QueryParam("fixedAreaId") String fixedAreaId);

	@Path("/customer")
	@POST
	@Consumes({ "application/xml", "application/json" })
	public void register(Customer customer);
	
	@Path("/customer/telephone/{telephone}")
	@GET
	@Consumes({ "application/xml", "application/json" })
	public Customer findByTelephone(@PathParam("telephone") String telephone);
	@Path("/customer/updateType/{telephone}")
	@GET
	public void updateType(@PathParam("telephone") String telephone);
	
	//登录使用
	@GET
	@Path("customer/login")
	@Consumes({"application/json","application/xml"})
	public Customer login(@QueryParam("telephone") String telephone,@QueryParam("password") String password);
	
	//获取定区编码
	@Path("customer/findFixedAreaIdByAddress")
	@GET
	@Consumes({"application/json","application/xml"})
	public String findFixedAreaIdByAddress(@QueryParam("address") String address);
}
